package cn.jn.lhm.msm.handler;

import cn.jn.lhm.msm.service.MsmService;
import cn.jn.lhm.utils.R;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author LHM
 * @Tips 热爱每一天，奋斗每一天
 * @date 2020/6/10 - 20:08
 */
@RestController
@RequestMapping("/msm")
public class MsmHandler {

    @Resource
    private MsmService msmService;


    @GetMapping("/send/{phoneNum}")
    public R sendMsm(@PathVariable("phoneNum")String num){
        boolean result = msmService.sendMsm(num);
        if (!result){
            return R.error().message("短信发送失败");
        }
        return R.ok();
    }

}
